package translate;

import temp.Label;
import tree.JUMP;
import tree.LABEL;
import tree.SEQ;

public class WhileExp extends Nx {
	public WhileExp(Exp t, Exp b, Label lDone) {
		super(null);
		Label lTest = new Label();
		Label lBody = new Label();
		stm = new SEQ(new LABEL(lTest), 
			new SEQ(t.unCx(lBody, lDone), 
				new SEQ(new LABEL(lBody),
					new SEQ(b.unNx(),
						new SEQ(new JUMP(lTest),
							new LABEL(lDone))))));
	}
}
